﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using YmSoft.WPF.Core;

namespace YmSoft.WPF.Sys
{
    /// <summary>
    /// WinLogin.xaml 的交互逻辑
    /// </summary>
    public partial class WinLogin : Window
    {
        public static RoutedCommand WinCmd = new RoutedCommand();
        public WinLogin()
        {
            InitializeComponent();
        }

        ICommand closeCommand = null;
        public ICommand CloseCommand
        {
            get
            {
                if (closeCommand == null)
                {
                    closeCommand = new RelayCommand(() => this.Close());
                }
                return closeCommand;
            }
        }

        ICommand loginCommand = null;
        public ICommand LoginCommand
        {
            get
            {
                if (loginCommand == null)
                {
                    loginCommand = new RelayCommand(
                        () =>
                        {
                            var win = new MainWindow();
                            //var win = new YmSoft.WPF.WenShiCanShuSheZhi.WinMain();
                            win.Show();
                            this.Close();
                        });
                }
                return loginCommand;
            }
        }

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            DevExpress.Xpf.Core.ThemeManager.ApplicationThemeName = "Seven";
            log4net.Config.XmlConfigurator.Configure();
        }
    }
}
